﻿package Utils 
{

	import Space.SpaceObjects.Star;
	import org.osflash.thunderbolt.Logger;
	
	public class StringParser 
	{
		
		public function StringParser() 
		{
			
		}
		
		public function MapString(mapString:String):Array
		{
			var objArray:Array = new Array();
			var tempStar:Space.SpaceObjects.Star; 
			var starInfo:Array = mapString.split("!");
			for (var cor:Number = 0; cor < starInfo.length; cor++)
			{
				var corInfo:Array = starInfo[cor].split("&");
				var corrdinate:Array = corInfo[0].split(";");
				var tempObj:Array = corInfo[1].split("~");
				var obj:Array = tempObj[0].split("#");
				if (obj[0] == 0)
				{
					tempStar = new Space.SpaceObjects.Star(corrdinate[0], corrdinate[1], corrdinate[2]);
					var planetResorse:Array = obj[1].split("|");
					for (var i = 0; i < planetResorse.length; i++)
					{
						var tempResours:Array = planetResorse[i].split { "," };
					}
					objArray[objArray.length] = tempStar; 
				}
			}
			
			return objArray;
		}
		
	}
	
}